{php}
{//var_dump($vo);}
{/php}
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">
        <div class="layui-form-item">
            <label class="layui-form-label label-required">会员名称</label>
            <div class="layui-input-block">
                {if $member_type ==1}
                    <input readonly name="name" value='{$vo.username|default=""}' required placeholder="请输入会员名称" class="layui-input">
                {else}
                    <input readonly name="name" value='{$vo.company_name|default=""}' required placeholder="请输入会员名称" class="layui-input">
                {/if}

            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">所选套餐</label>
             <div class="layui-input-block">
    
                <select  class="layui-select" name="commodity_type" >
                <option value="">-- 设置套餐 --</option>
                    {foreach $commodity_list as $key=>$val}
                        {if($val.id eq @$vo.commodityid )}
                       
                        <option selected value="{$val.id}">
                            {$val.title}|{$val.money}RMB|
              {if condition="($val.year neq 0)"}
                   {$val.year|default=''}/年付
                {elseif condition="($val.month neq 0)"/}
                    {$val.month|default=''}/月付
                {elseif condition="($val.day neq 0)"/}
                   {$val.day|default=''}/日付
                {else /}
                {/if}
               
                {if condition="($val.outAppnumber neq 0)"}
                限制接待人数:
             {$val.outAppnumber|default=''}人
                {/if}
                {if condition="($val.outnumber neq 0)"}
                限制公司人数:
              {$val.outnumber|default=''}人
                {/if}

                        </option>
                        {else}
                        <option value="{$val.id}">
                            {$val.title}|{$val.money}RMB|
              {if condition="($val.year neq 0)"}
                   {$val.year|default=''}/年付
                {elseif condition="($val.month neq 0)"/}
                    {$val.month|default=''}/月付
                {elseif condition="($val.day neq 0)"/}
                   {$val.day|default=''}/日付
                {else /}
                {/if}
               
                {if condition="($val.outAppnumber neq 0)"}
                限制接待人数:
             {$val.outAppnumber|default=''}人
                {/if}
                {if condition="($val.outnumber neq 0)"}
                限制公司人数:
              {$val.outnumber|default=''}人
                {/if}</option>
                      
                        {/if}

                    {/foreach}
                </select>
            </div>
        </div>
		 <div class="layui-form-item">
		    <label class="layui-form-label label-required">开通套餐时间</label>
		    <div class="layui-input-inline margin-right-0" style="width:164px">
		       <input type="text" data-date-input="datetime" name="payTime" value='{$vo.create_at|default=""}' placeholder="开通套餐时间" class="layui-input">
		   </div>
		</div>
		<div class="layui-form-item">
		    <label class="layui-form-label label-required">套餐到期时间</label>
		  <div class="layui-input-inline margin-right-0" style="width:164px">
		     <input type="text" data-date-input="datetime" name="expritime" value='{$vo.vip_date|default=""}' placeholder="套餐到期时间" class="layui-input">
		 </div>
		</div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
    {notempty name='member_type'}<input type='hidden' value='{$member_type}' name='member_type'>{/notempty}
    <div class="layui-form-item text-center">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>

    <script>window.form.render();</script>

</form>

<script>
    var login={
	check:function(){
		//获取登录页面中的用户名 和 密码
		var name=$('input[name="name"]').val(),
			commodityId=$('input[name="commodityId"]').val();
		
		var url="viplist/edit",
			data={
				"name":name,
				"commodityId":commodityId
			};
		var load = dialog.load();
		$.post(url,data,function(result){
			layer.close(load);
			// alert("");
			if(result.code==400){
				return dialog.error(result.message);
			}
			if(result.code==200){
				return dialog.success(result.message,'{:url("viplist/index")}');
			}
			// return dialog.success(result.message,"{:url('admin/index')}");
		},'JSON');
	}
}
</script>
